using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Grid
{
    public Transform Transform { get; set; }
    public IGridItem GridItem { get; set; }
    public Box2DCollider Collider { get; private set; }
    public Vector2Int Position { get; private set; }

    private GameObject gridGo;
    private SpriteRenderer spriteRenderer;

    public Grid(GameObject gridGo, Vector2Int position)
    {
        this.gridGo = gridGo;
        Position = position;
        Transform = gridGo.transform;
        spriteRenderer = gridGo.GetComponent<SpriteRenderer>();
        Collider = gridGo.GetComponent<Box2DCollider>();
    }

    public void PlacePreview(bool show = true)
    {
        if (show)
            spriteRenderer.color = Color.green;
        else
            spriteRenderer.color = Color.white;
    }
}
